package com.gaocf.designpatterns.create.singleton;

/**
 * 懒汉式：线程安全，效率低，延迟加载
 */
public class Singletion2 {
    private static Singletion2 instance;

    private Singletion2() {

    }

    public static synchronized Singletion2 getInstance() {
        if (instance == null)
            instance = new Singletion2();
        return instance;
    }
}